package cn.xttc.edu.service.impl;

import cn.xttc.edu.entity.ExpenseRule;
import cn.xttc.edu.entity.vo.RuleVo;
import cn.xttc.edu.mapper.ExpenseRuleMapper;
import cn.xttc.edu.service.ExpenseRuleService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 杨磊
 * @since 2022-02-27
 */
@Service
public class ExpenseRuleServiceImpl extends ServiceImpl<ExpenseRuleMapper, ExpenseRule> implements ExpenseRuleService {

    @Autowired
    ExpenseRuleMapper ruleMapper;

    /**
     * 查询所有规则分页显示
     * @param page pageGetAll
     * @return
     */
    @Override
    public IPage<RuleVo> pageGetAll(Page<RuleVo> page) {
        return ruleMapper.pageGetAll(page);
    }

    @Override
    public RuleVo getOneByTypeId(Integer typeId) {
        return ruleMapper.getOneByTypeId(typeId);
    }
}
